﻿using System.Windows;
using System.Windows.Controls;
namespace Tfs.OnTheRoad.Controls
{
    /// <summary>
    /// Reusable WorkItems List Control
    /// DataContext should be a WorkItemListViewModel.cs
    /// </summary>
	public partial class WorkItemsListControl : UserControl
	{
        public WorkItemsListControl()
		{
			// Required to initialize variables
			InitializeComponent();
            this.Loaded += new RoutedEventHandler(WorkItemsListControl_Loaded);
		}

        void WorkItemsListControl_Loaded(object sender, RoutedEventArgs e)
        {
            //We set it to -1 to avoid that the selectionChanged event is not being triggered if we are coming back
            //to this page(back button)
            WorkItemsListBox.SelectedIndex = -1;
        }
	}
}